package com.etc.test;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.jupiter.api.Test;

import com.etc.entity.Dept;
import com.etc.entity.Employees;
import com.etc.service.IDeptService;
import com.etc.service.IEmployeesService;
import com.etc.service.impl.AttendanceServiceImpl;
import com.etc.service.impl.DeptServiceImpl;
import com.etc.service.impl.EmployeesServiceImpl;
import com.etc.util.DBUtil;
import com.etc.util.MD5Util;
import com.etc.util.PageData;

public class dlqcs {

	AttendanceServiceImpl service=new AttendanceServiceImpl();
	
	IEmployeesService service1=new EmployeesServiceImpl();
	
	IDeptService service2=new DeptServiceImpl();

	@Test
	public void queryAll() {
		List<Employees> list = service1.getAllEmployees();
		for (Employees article : list) {
			System.out.println(article);
		}
	}
	@Test
	public void queryAlls() {
		
		PageData lists = service1.getqueryAllEmployeesd(1, 3);
		List<Employees> list=lists.getData();
		for (Employees article : list) {
			System.out.println(article);
		}
	}
	@Test
	public void eqPwd() {
		String p1 = "123456";
		System.out.println(MD5Util.doubleEncryption(p1).equals(MD5Util.doubleEncryption(p1)));
	
	}
	
	
	@Test
	public void add() {
		boolean flag=service1.addEmployees(new  Employees("8","8","8",null,new Dept(2,"2"),null,0),2);
		if (flag) {
			System.out.println("添加成功");
		} else {
			System.out.println("添加失败");
		}		
	}
	@Test
	public void queryAlld() {
		List<Dept> list = service2.getqueryDept();
		for (Dept article : list) {
			System.out.println(article);
			System.out.println(article.getDeptName()+article.getDeptId());
		}
	}
	
	@Test
	public void mmdd() {
		boolean flag=service1.modifyEmployees(new Employees(80033,"8","8","8","2018-10-12",new Dept(2,"2"),null,0),2);
		if (flag) {
			System.out.println("修改成功");
		} else {
			System.out.println("修改失败");
		}		
	}
	@Test
	public void delss() {
		boolean b = service1.delsEmployees(80028);
		System.out.println(b);
	}
	@Test
	public void testPath() {
		SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
		System.out.println(sdf.format(new Date()));
		
	}
	
}
